import request from '@/utils/request.js';

const API = {
    // 公告记录
    GET_NOTICE_NOTE_URL: '/v01/biz/inform/listInform',
    // 发布公告
    PUBLIC_NOTICE_URL: '/v01/biz/inform/saveInform',
    // 根据id获取公告
    GET_NOTICE_NOTE_BYID_URL: '/v01/biz/inform/informInfo'
};

// 获取公告记录
export const reqNoticeNote = idNum =>
    request.get(`${API.GET_NOTICE_NOTE_URL}?userNum=${idNum}`);

// 发布公告
export const reqPublicNotice = (data, idNum) =>
    request.post(`${API.PUBLIC_NOTICE_URL}?userNum=${idNum}`, data);

// 根据id获取公告
export const reqNoticeNoteById = (informId, id) =>
    request.get(
        `${API.GET_NOTICE_NOTE_BYID_URL}?userNum=${id}&informId=${informId}`
    );
